﻿/*
 * XDevelopHelper
 *  @Author: XTST
 *  @Git: https://gitee.com/XTST/XUnityDevelopHelper
 *  Copyright © 2013-2018 Xiaotian Jin. All rights reserved.
 * */

namespace XDevelopHelper.FSM
{
    public interface IFSM<TOwner> where TOwner : class 
    {
        #region Data

        string Name { get; }
        TOwner Owner { get; }

        bool IsRunning { get; }

        FSMState<TOwner> CurrentFSMState { get; }

        #endregion

        #region State Manager

        void Start<T>() where T : FSMState<TOwner>;
        bool HasState<T>() where T : FSMState<TOwner>;
        T GetState<T>() where T : FSMState<TOwner>;

        #endregion

        #region Data Manager

        bool HasData(string name);
        T GetData<T>(string name);
        void SetData<T>(string name, object data);
        void RemoveData(string name);

        #endregion

        #region State Changer

        void ChangeState<T>() where T : FSMState<TOwner>;

        #endregion
    }
}
